<template>
    <div>
        <el-dialog title="编辑时间" :visible.sync="dialogVisible" width='500px' append-to-body v-dialogDrag :close-on-click-modal="false" >
            <div>
                <el-form ref="rowdata" :model="rowdata" label-width="100px" class="personeditform"  status-icon >
                    <el-form-item label="姓名" >
                        <el-input v-model="rowdata.truename" style="width: 80%;" :disabled="true"></el-input>
                    </el-form-item>
                    <el-form-item label="身份证号" >
                        <el-input v-model="rowdata.personid" style="width: 80%;" :disabled="true"></el-input>
                    </el-form-item>
                    <el-form-item label="入党意愿时间" prop="datea">
                        <el-date-picker v-model="rowdata.datea" type="date" placeholder="" value-format="yyyy-MM-dd"></el-date-picker>
                    </el-form-item>
                    <el-form-item label="入党积极分子时间" prop="dateb">
                        <el-date-picker v-model="rowdata.dateb" type="date" placeholder="" value-format="yyyy-MM-dd"></el-date-picker>
                    </el-form-item>
                    <el-form-item label="重点培养对象时间" prop="datec">
                        <el-date-picker v-model="rowdata.datec" type="date" placeholder="" value-format="yyyy-MM-dd"></el-date-picker>
                    </el-form-item>
                    <el-form-item label="预备党员时间" prop="dated">
                        <el-date-picker v-model="rowdata.dated" type="date" placeholder="" value-format="yyyy-MM-dd"></el-date-picker>
                    </el-form-item>
                    <el-form-item label="正式党员时间" prop="datee">
                        <el-date-picker v-model="rowdata.datee" type="date" placeholder="" value-format="yyyy-MM-dd"></el-date-picker>
                    </el-form-item>
                </el-form>
                <el-row style="position: relative;width: 100%;">
                    <el-button style="margin: 0 auto;display: block;"  type="primary" @click="uploadAjax('rowdata')">确定并保存<i class="el-icon-upload el-icon--right" ></i></el-button>
                </el-row>
            </div>
        </el-dialog>
    </div>
</template>
<script>
    import {mapActions} from 'vuex';
    export default {
        data() {
            return { 
                dialogVisible: false, 
                rowdata:{
                    truename:'',
                    personid:'',
                    datea:'',
                    dateb:'',
                    datec:'',
                    dated:'',
                    datee:'',
                },
            };
            
        },
        mounted() {},
        components: {},
        watch: {},
        methods: {
            uploadAjax(){
                let _this=this;
                let postdata={
                    type:"updatedyfztime",
                    split:JSON.stringify(this.rowdata)
                }
                this.$Common.AjaxPost(postdata,true)
                .then(function(e){
                    _this.$message("操作成功");
                    _this.dialogVisible=false;
                    _this.$emit('editResult');
                },function(){
                     _this.$message("操作失败");
                })
                .catch(function(reason) {
                    console.log('catch:', reason);
                });
            },
        },

    }
</script>
<style scoped>
label.el-form-item__label{
    width: 140px;
}
div.el-form-item__content{
    margin-left: 140px;
}

</style>